/*
 * Daniel R Padilla
 *
 * Copyright (c) 2008, Daniel R Padilla
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */
package org.databasefacade.select.functions;

import java.util.ArrayList;

import org.databasefacade.exception.DatabaseFacadeException;
import org.databasefacade.translator.Translator;

public class AbstractFunction implements Function {
	protected String functionType;
	protected boolean isAggregate=false;
	protected boolean isSupported=false;
	protected ArrayList parameters=new ArrayList();
	protected Translator translator;
	
	public String getFunctionType() {
		return functionType;
	}
	public boolean isAggregate(){
		return isAggregate;
	}
	public boolean isSupported() {
		return isSupported;
	}
	public ArrayList getParameters(){
		return parameters;
	}
	public String getSQL(Translator translator){
		return translator.getFunctionSQL(functionType, parameters);
	}
	public Object applyIfUnsupported(Object data) throws DatabaseFacadeException {
		throw new DatabaseFacadeException("The function you requested is not currently supported by the your database or the database dacade library.");
	}
}
